package com.tsystems.school;

/**
 * Created by IntelliJ IDEA.
 * User: victorn
 * Date: 8/14/11
 * Time: 12:29 AM
 * To change this template use File | Settings | File Templates.
 */
public class ListItem<K, V> {

    private K key;
    private V value;

    ListItem<K, V> next;

   /**
     * @param key
     * @param val
     * @param next Link to the next item in the list
     */
    public ListItem(K key, V val, ListItem<K, V> next) {
        this.key = key;
        value = val;
        this.next = next;
    }

   /**
     *
     * @return Key of the item
     */

    public K getKey() {
        return key;
    }

   /**
     *@brief Sets key of the item
    *
     * @param key
     */
    public void setKey(K key) {
        this.key = key;
    }

    /**
     *
     * @return Value of the item
     */
    public V getValue() {
        return value;
    }

    /**
     *
     * @param value Value to set
     */
    public void setValue(V value) {
        this.value = value;
    }

    /**
     *
     * @return Link to the next element in the list
     */
    public ListItem<K, V> getNext() {
        return next;
    }

    /**
     *
     * @param next Link to the next element in the list
     */
    public void setNext(ListItem<K, V> next) {
        this.next = next;
    }
}
